<!DOCTYPE HTML>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>

<div class="container">
    <div id="grid" role="grid" aria-owns="row1 row2"></div>
    <div id="row1" role="row">
        <div role="gridcell">Cell 1, 1</div>
        <div role="gridcell">Cell 1, 2</div>
        <div role="gridcell">Cell 1, 3</div>
    </div>
    <div id="row2" role="row">
        <div role="gridcell">Cell 2, 1</div>
        <div role="gridcell">Cell 2, 2</div>
        <div role="gridcell">Cell 2, 3</div>
    </div>
</div>

<script>
test(function(t) {
    var axGrid = accessibilityController.accessibleElementById("grid");
    assert_equals(axGrid.role, "AXRole: AXGrid");
    assert_equals(axGrid.columnCount, 3);
    assert_equals(axGrid.rowCount, 2);
}, "Aria-owns works on ARIA grids.");
</script>
